package com.xhy.tool;

import com.xhy.tool.authority.AuthorityUtils;
import com.xhy.tool.authority.UnifyAuthorityVerify;
import com.xhy.tool.authority.XhyAuthority;
import com.xhy.tool.entity.User;
import com.xhy.tool.utils.SpringUtil;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.transaction.annotation.EnableTransactionManagement;

@SpringBootApplication()
@MapperScan("com.xhy.tool.mapper")
@EnableTransactionManagement
@EnableAspectJAutoProxy
public class AuthorizeApplication {
    public static void main(String[] args) {
        AuthorityUtils.exclude("/login","/authorize/permission/initMenu");
        // 开启postMapper校验
        AuthorityUtils.setPostAuthority(true,new UnifyAuthorityVerify());
        // 开启全局校验
//        AuthorityUtils.setGlobalAuthority(true,new XhyAuthority());
        SpringApplication.run(AuthorizeApplication.class, args);
    }
}
